import React from 'react';
import  { Route,Link,Switch,Redirect} from 'react-router-dom'
import ProductList from 'page/produce/index/index.jsx'
import ProductSave from 'page/produce/index/save.jsx'
import CategoryList from "page/produce/produce-catogery/indexs.jsx";
import CategoryAdd from "page/produce/produce-catogery/add.jsx";





class ProductRouter extends React.Component{

    render(){
        return(
            <Switch>
                <Route  path="/produce/index" component={ProductList}></Route>
                <Route  path="/produce/save" component={ProductSave}></Route>
                <Route  path="/produce-category/index/:categoryId?" component={CategoryList}></Route>
                <Route  path="/produce-category/add" component={CategoryAdd}></Route>
                <Redirect exact to="/produce/index" from="/produce"></Redirect>
                <Redirect exact to="/produce-category/index" from="/produce-category"></Redirect>
            </Switch>


        )
    }
}


export default ProductRouter;